<%@ page pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
    <head>
        <title>KKBus</title>
        <meta charset="utf-8" />   
        <link type="text/css" href="resources/template/css/layout.css" rel="stylesheet" />
	<script type="text/javascript" src="resources/template/js/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="resources/template/js/easyTooltip.js"></script>
	<script type="text/javascript" src="resources/template/js/jquery-ui-1.7.2.custom.min.js"></script>
	<script type="text/javascript" src="resources/template/js/jquery.wysiwyg.js"></script>
	<script type="text/javascript" src="resources/template/js/hoverIntent.js"></script>
	<script type="text/javascript" src="resources/template/js/superfish.js"></script>
        <script type="text/javascript" src="resources/template/js/custom.js"></script>
    </head>
    <body>
        <div id="template">
            <div style="text-align: center; margin-top: 150px;">
                <img src="resources/img/ajax-loader.gif" alt="Wczytuję..." title="Wczytuję..." />
            </div>
        </div> 
        <!-- JavaScript Files -->
        <script type="text/javascript" src="resources/js/library/knockout-2.2.1.js"></script>
        <script type="text/javascript" src="resources/js/library/signals.min.js"></script>
        <script type="text/javascript" src="resources/js/library/crossroads.min.js"></script>
        <script type="text/javascript" src="resources/js/library/hasher.min.js"></script>
        <script type="text/javascript" src="resources/js/app.js"></script>
        <script type="text/javascript" src="resources/js/util/ajax.js"></script>
        <script type="text/javascript" src="resources/js/util/validation.js"></script>
        <script type="text/javascript" src="resources/js/util/jqueryui.js"></script>
        <script type="text/javascript" src="resources/js/util/format.js"></script>
        <!-- Models -->
        <script type="text/javascript" src="resources/js/model/user.js"></script>
        <script type="text/javascript" src="resources/js/model/news.js"></script>
        <script type="text/javascript" src="resources/js/model/gift.js"></script>
        <script type="text/javascript" src="resources/js/model/busstop.js"></script>
        <script type="text/javascript" src="resources/js/model/departuretime.js"></script>
        <script type="text/javascript" src="resources/js/model/ticketprice.js"></script>
        <script type="text/javascript" src="resources/js/model/historylog.js"></script>
               <script type="text/javascript" src="resources/js/model/bus.js"></script>
        <!-- Controllers -->
        <script type="text/javascript" src="resources/js/controller/authentication.js"></script> 
        <script type="text/javascript" src="resources/js/controller/news.js"></script> 
        <script type="text/javascript" src="resources/js/controller/gifts.js"></script> 
        <script type="text/javascript" src="resources/js/controller/busstop.js"></script> 
         <script type="text/javascript" src="resources/js/controller/ticketprice.js"></script> 
         <script type="text/javascript" src="resources/js/controller/historylog.js"></script> 
         <script type="text/javascript" src="resources/js/controller/user.js"></script> 
         <script type="text/javascript" src="resources/js/controller/admin.js"></script>
         <script type="text/javascript" src="resources/js/controller/bus.js"></script>
           <!-- Templates -->
        <script type="text/html" id="loader-template">
            <div style="text-align: center; margin-top: 150px;">
                <img src="resources/img/ajax-loader.gif" alt="Wczytuję..." title="Wczytuję..." />
            </div>
        </script>
        <script type="text/html" id="main-template">
            <div id="container">
                <div id="header">
                    <div id="top">
                        <div class="logo"> 
                            <a href="#" title="Administration Home" class="tooltip"><img src="resources/img/logoo.png" alt="Wide Admin" /></a> 
                        </div>					
                        <div class="meta">
                            <p>Witaj, <span data-bind="text: AuthenticationController.user.name"></span> <span data-bind="text: AuthenticationController.user.surname"></span></p>
                            <ul>
                                <!-- ko if: AuthenticationController.authenticated -->
                                <li><a href="j_spring_security_logout" title="Wyloguj" class="tooltip"><span class="ui-icon ui-icon-power"></span>Wyloguj</a></li>
                                <li><a href="#editprofile" title="Ustawienia" class="tooltip"><span class="ui-icon ui-icon-wrench"></span>Ustawienia</a></li>
                                <li><a href="#points" title="Stan Puntków" class="tooltip"><span class="ui-icon ui-icon-person"></span>Stan Puntków</a></li>
                                <!-- /ko -->
                                <!-- ko ifnot: AuthenticationController.authenticated -->
                                <li><a href="login" title="Zaloguj" class="tooltip"><span class="ui-icon ui-icon-power"></span>Zaloguj</a></li>
                                <!-- /ko -->
                            </ul>	
                        </div>
                    </div>
                    <div id="navbar">
                        <ul class="nav">
                        
                               
                            <li><a href="#home" title="Strona główna">Strona główna</a></li>
                            
                            
                            
                            <li><a href="#">Dane ogólne</a>
                            <ul>
                                    <li><a href="#news" title="Aktualności">Aktualności</a></li>
                                    <li><a href="#contact" title="Kontakt">Kontakt</a></li>
                            </ul>
                            </li>
                            
                                <li><a href="#">Grafik kursów</a>
                                
                                <ul>
				<li><a href="#searchcourses">Wyszukaj kurs</a></li>
				</ul>
				</li>
                             
                                <li><a href="#ticketprice">Cennik</a></li>
						
				<li><a href="#">Program lojalosciowy</a>
				<ul>
				<li><a href="#gifts">Przegladanie nagród</a></li>
				</ul>
				</li>
                                
                            <!-- ko ifnot: AuthenticationController.authenticated -->    
                            <li><a href="#registration" title="Rejestracja">Rejestracja</a></li>
                            <!-- /ko -->
                             
                            <li data-bind="visible: AuthenticationController.hasRole('USER')"><a href="#" title="Coś dla zarejestrowanego usera">Historia</a>
                            <ul>
                                <li><a href="#historylog">Logowań</a></li>
				<li><a href="#booking">Rezerwacji</a></li>
                                <li><a href="#history">Przejazdów</a></li>
				</ul>
                            </li>
                            
                            <li data-bind="visible: AuthenticationController.hasRole('ADMIN')"><a href="#" title="Zarządzaj">Zarządzaj</a>
                            
                            <ul>
				<li><a href="#employelist">Pracownikami</a></li>
                                <li><a href="#schedule">Godzinami Pracy</a></li>
<!--                                <li><a href="#">Zarządzanie Nagrodami</a></li>-->
				</ul>
                            
                            </li>
                            <li data-bind="visible: AuthenticationController.hasRole('ADMIN')"><a href="#list" title="Lista">Lista</a></li>
                            <li data-bind="visible: AuthenticationController.hasRole('ADMIN')"><a href="#statistics" title="Statystyki">Statystyki</a></li>
                            <li data-bind="visible: AuthenticationController.hasRole('WORKER')"><a href="#" title="Zarządzanie">Zarządzanie</a>
                                <ul>
				<li><a href="#clientlist">Klientami</a></li>
                                <li><a href="#managingroutes">Trasami</a></li>
                                
				</ul>
                            
                            </li>
                        </ul>
                    </div>
                    <!--
                    <div id="search">
                        <form action="#" method="POST">
                            <p>
                                <input type="submit" value="" class="but" />
                                <input type="text" name="q" value="Szukaj" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" />
                            </p>
                        </form>
                    </div> -->
                </div>
                <div id="bgwrap">
                    <div id="content">
                        <div id="ajax-loader" style="margin-left: 285px; display: none;"><img src="resources/img/mini-ajax-loader.gif" alt="Wczytuję..." title="Wczytuję..." /></div>
                        <div id="main" style="min-height: 350px;" data-bind="template: { name: app.subpage, data: $root, afterRender: jQueryUI.init }"></div>
                    </div>
                    <div id="sidebar">
                        <h2>Kalendarz</h2>
                        <div id="datepicker"></div>
                    </div>
                </div>
            </div>
            <div id="footer">
                <p class="mid">
                    <a href="#home" title="Strona główna" class="tooltip">Strona główna</a>&middot;<a href="#contact" title="Kontakt" class="tooltip">Kontakt</a>
                </p>
                <p class="mid">&copy; Politechnika Krakowska - Wydział Mechaniczny 2013. Wszelkie prawa zastrzeżone.</p>
            </div>
        </script>
        <script type="text/html" id="empty-template"></script>
        
        
         
        <script type="text/html" id="booking-template">			
			
	<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
                        
                        <td>Rezerwacja</td>
			<td>Opcje</td>
			
		</thead>
		<tbody>
                
		<tr  class="odd">
			
			<td> Rezerwacja z kraków do katowic</td>
                      	<td><p><a href="#" class="button tooltip" title="Usuń"><span class="ui-icon ui-icon-trash"></span>Usuń/Anuluj</p></td>
                </tr>
					
                </tbody>
        </table>              
        </script>
        
              <script type="text/html" id="history-template">			
			
	<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
                        
                        <td>Historia Przejazdów</td>
			<td>Data</td>
			
		</thead>
		<tbody>
                
		<tr  class="odd">
			
			<td> Kraków dworzec -> katowice dworzec</td>
                      	<td><p><a href="#" class="button tooltip" title="Usuń"><span class="ui-icon ui-icon-trash"></span>Usuń/Anuluj</p></td>
                </tr>
					
                </tbody>
        </table>              
        </script>
        
               <script type="text/html" id="historylog-template">			
	
                   
                 
	<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
                 <h1>Witaj <span data-bind="text: AuthenticationController.user.name"></span></span> , twoja historia</h1>        
                       
			<td>Data</td>
		</tr>	
		</thead>
		
                <tbody  data-bind="foreach: HistoryLogController.historylog">
                
                    <tr class="odd">
			
                      	<td data-bind ="text: date" ></td>
                </tr>
					
                </tbody>
                
        </table>              
        </script>
        
        <script type="text/html" id="clientlist-template">			
			
	<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
<td>ID</td>                        <td>Imie</td>
                        <td>Nazwisko</td>
			<td>Opcje</td>
                        
			
		</thead>
		<tbody data-bind="foreach: UserController.user">

		<tr  class="odd">
			<td  data-bind = "text: id" ></td>			<td  data-bind = "text: name" ></td>
                        <td  data-bind = "text: surname" ></td>
                        
                       
                		
							<td> <input class="button" id="usu" type="submit" value="Usuń" data-bind="click: function() { app.Knockout.AuthenticationController.deleteUser(id()); }" />
                          <input class="button" id="usu" type="submit" value="Blokuj" data-bind="click: function() { app.Knockout.AuthenticationController.banUser(id()); }"/>
                          <input class="button" id="usu" type="submit" value="Odblokuj" data-bind="click: function() { app.Knockout.AuthenticationController.unbanUser(id()); }"/>
                             <input class="button" id="usu" type="submit" value="Pokaż Nagrody"/>                        </td>
                           
                </tr>
					
                </tbody>
        </table>              
        </script>
        
        
        <script type="text/html" id="managingroutes-template">			
	 <div class="pad20">
		<h1>Rozkład Jazdy</h1>
                
		<select name="formKierunek" class="dropdown" id="formKierunek">
			<option value="0">Kraków-Katowice</option>
			<option value="1">Katowice-Kraków</option>
		</select>
               
               <input class="button" type="button" value="Pokaż" data-bind="click: BusStopController.showCourses" />
               
             </div>
                <div class="pad20" data-bind="visible: BusStopController.viewCourses0">
                    <table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
                        
                        <td>Kierunek</td>
			<td>Przystanek</td>
                        <td>Opcje</td>
			
		</thead>
		<tbody data-bind="foreach: BusStopController.coursesKrk" > 
                
		<tr  class="odd">
			
			<td  data-bind="text: direction"></td>
                        <td> KrakówRDA </td>
                      	<td><a href="#" class="button tooltip" title="Usuń"><span class="ui-icon ui-icon-trash"></span>Usuń</td>
                </tr>
					
                </tbody>
        </table>        
        </div>
               
		<label for="formPrzystanek">Kierunek: </label>
                
                
                <select name="formKierunek" class="dropdown" id="formKierunek">
			<option value="0">Kraków-Katowice</option>
			<option value="1">Katowice-Kraków</option>
		</select>
               
		<label for="formPrzystanek">Przystanek: </label>
 		<input class="mff" name="formPrzystanek" id="formPrzystanek" type="text" placeholder="Podaj przystanek.." required/> 
		<a href="#" class="button tooltip" title="Dodaj"><span class="ui-icon ui-icon-circle-plus"></span>Dodaj										
		</script>
                
    
     <script type="text/html" id="employelist-template">			
			
	<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
                       <td>Id</td>
                        <td>Nazwisko</td>
                        <td>Imie</td>
			<td>Opcje</td>
			
		</thead>
		<tbody data-bind="foreach: AdminController.worker">
                
		<tr  class="odd">
			
			<td  data-bind = "text: id" ></td>
			<td  data-bind = "text: name" ></td>
                        <td  data-bind = "text: surname" ></td>
                      	<td><input class="button" id="usu" type="submit" value="Usuń" data-bind="click: function() { app.Knockout.AuthenticationController.deleteUser(id()); }" />
                            <input class="button" id="usu" type="submit" value="Blokuj" data-bind="click: function() { app.Knockout.AuthenticationController.banUser(id()); }"/>
                            <input class="button" id="usu" type="submit" value="Odblokuj" data-bind="click: function() { app.Knockout.AuthenticationController.unbanUser(id()); }"/>
                           
                         </td>
                </tr>
					
                </tbody>
        </table>              
      </script>
        
        
         <script type="text/html" id="schedule-template">			
			
	<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
                        
                        <td>Użytkownik</td>
			<td>Poniedziałek</td>
			<td>Wtorek</td>
                        <td>Środa</td>
                        <td>Czwartek</td>
                        <td>Piątek</td>
                        <td>Sobota</td>
                        <td>Niedziela</td>
                  </tr>
                 </thead>
		<tbody>
                
		<tr  class="odd">
			
			<td> kierowca5</td>
                                             
                </tr>
		<tr  class="odd">
			
			<td> kierowca4</td>
                                             
                </tr>
                <tr  class="odd">
			
			<td> kierowca3</td>
                                             
                </tr>
                <tr  class="odd">
			
			<td> kierowca2</td>
                                             
                </tr>
                <tr  class="odd">
			
			<td> kierowca1</td>
                                             
                </tr>
                </tbody>
        </table>              
        </script>
        
        <script type="text/html" id="list-template">			
			
                <table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
                        <td>Id</td>
                        <td>Nazwa</td>
                        <td>Rejstracja</td>
                        
			<td>Opcje</td>
                        </tr>
		</thead>
		<tbody data-bind="foreach: BusController.bus">
                
                
		<tr  class="odd">
			
			<td  data-bind = "text: id"></td>
                      	<td data-bind =  "text: brand"></td>
                        <td data-bind =  "text: registartion"></td>
                          
                        <td> 
                            <input class="button" id="usu" type="button" value="Pokaż Usterki" />
                           <input class="button" id="usun" type="button" value="Pokaż Tankowania"/>
                         </td>
                </tr>
					
                </tbody>
        </table>  
        
        <div  data-bind="visible: AuthenticationController.wiad">
              <table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
                        <td>Id</td>
                        <td>Nazwa</td>
                        <td>Rejstracja</td>
                        
			<td>Opcje</td>
                        </tr>
		</thead>
		
                
        </div>
        </script>
        
        <script type="text/html" id="home-template">
            <h1>Witaj, <span data-bind="text: AuthenticationController.user.name"></span> <span data-bind="text: AuthenticationController.user.surname"></span></h1>
            <div class="pad20" data-bind="visible: AuthenticationController.authenticated">
                <ul class="dash">
                  <li>
			<a href="#ticketprice" title="Calculator" class="tooltip">
			<img src="resources/template/assets/icons/30_48x48.png" alt="" />
			<span>Kalkulator Usług</span>
			</a>
			</li>
                    <li>
                        <a href="#news" title="What your team posted" class="tooltip">
                            <img src="resources/template/assets/icons/7_48x48.png" alt="" />
                            <span>Last articles</span>
                        </a>
                    </li>
                    <li>
                        <a href="#editprofile" title="Manage users and accounts" class="tooltip">
                            <img src="resources/template/assets/icons/16_48x48.png" alt="" />
                            <span>Users</span>
                        </a>
                    </li>  
                    
                    
                    <li>
                    <a href="#points" title="Browse for files" class="tooltip">
			<img src="resources/template/assets/icons/21_48x48.png" alt="" />
			<span>Punkty</span>
			</a>
		</li>
                
                
                <li>
			<a href="#gifts" title="Lorem ipsum" class="tooltip">
                            <img src="resources/template/assets/icons/20_48x48.png" alt="" />
                            <span>Nagrody</span>
			</a>
		</li>
                </ul>
            </div>
        </script>
        <script type="text/html" id="contact-template">
           
            <h1>Kontakt</h1>
            <div class="pad20">
                <div class="center">
                    <p>Właściciel: Jan Kowalski</p>
                    <p>Adres: ul. Jana Pawła II 37, 31-864 Kraków</p>
                    <p>Telefon/fax: (070) 012-34-56, (070)-011-22-33</p>
                    
                 </div>   
             <div class="message success close" data-bind="visible: AuthenticationController.success">
                <h2>Congratulations!</h2>
                <p>Wiadomość została wysłana pomyślnie.</p>
            </div>
            <div class="message error close" data-bind="visible: AuthenticationController.validation">
                <h2>Error!</h2>
                <p data-bind="text: AuthenticationController.errorMessage"></p>
            </div>
            <form id="formMail" name="formMail">


              <p>
                    <label for="formEmail2">Adres e-mail</label>
                    <input class="mff" id="formEmail2" name="formEmail2" type="text" value=""/>
              </p>
              <p>
                    <label for="formKategoria">Kategoria</label>
                    <select name="formKategoria" class="dropdown" id="formKategoria">
					<option>Pomoc</option>
					<option>Zgłoszenie błędu</option>
					<option>Feedback</option>
					<option>Inne</option>
					</select>
              </p>
              <p>
                     <label for="formTemat">Temat</label>
                     <input class="mff" id="formTemat" name="formTemat" type="text" value="" />
              </p>  
              
              <p>
                     <label for="formTresc">Treść:</label><br></br>
                     <textarea id="formTresc" name="formTresc" cols="30" rows="40"></textarea>
                     
                     
              </p> 
            
                 
                <p>
			<input class="button" id="wys" type="submit" value="Wyślij wiadomość" data-bind="click: AuthenticationController.sendEmail"/>
			<input class="button" type="reset" value="Wyczyść formularz" />
		</p>
           
               
                </form>
                </div>
        </script> 
        
        <script type="text/html" id="editprofile-template">
            <div class="message success close" data-bind="visible: AuthenticationController.success">
                <h2>Congratulations!</h2>
                <p>Dane zostały pomyślnie zapisane</p>
            </div>
            <div class="message error close" data-bind="visible: AuthenticationController.validation">
                <h2>Error!</h2>
                <p data-bind="text: AuthenticationController.errorMessage"></p>
            </div>
                <div class="pad20">
            <div id="tabs">
                
							
			<!-- First tab -->
				<div id="tabs-1">
				<div id="tabs-3">
				<ul id="icons" class="ui-widget ui-helper-clearfix">
				<form method="post" action="#" id="formularz">
				<!-- Fieldset -->
				<fieldset>
<!--                                   <p>  
                                   <li class="ui-state-default ui-corner-all" title="Edytuj"> <span class="ui-icon ui-icon-pencil">   </span></li>
                                   </p>-->
                                   <p>
                                        <li class="ui-state-default ui-corner-all" title="Edytuj" data-bind="click: AuthenticationController.enableInput"> <span class="ui-icon ui-icon-pencil">   </span></li>
					<label for="formImie">&nbsp;Imie: </label>
					<input data-bind="value: AuthenticationController.user.name, enable: AuthenticationController.editName"  class="mff" name="formImie" id="formImie" type="text" placeholder=""  /> 
                                                                         </p>
                                    
                                   <p>
                                        <li class="ui-state-default ui-corner-all" title="Edytuj" data-bind="click: AuthenticationController.enableInput2"> <span class="ui-icon ui-icon-pencil">   </span></li>
					<label for="formNazwisko">&nbsp;Nazwisko: </label>
 					<input data-bind="value: AuthenticationController.user.surname, enable: AuthenticationController.editSurname" class="mff" name="formNazwisko" id="formNazwisko" type="text" placeholder=""/> 
												
                                   
                                   
                                   <p>
                                         <li class="ui-state-default ui-corner-all" id="edycja1" title="Edytuj" data-bind="click: AuthenticationController.enableInput3"> <span class="ui-icon ui-icon-pencil">   </span></li>
                                         <label for="formTel">&nbsp;Telefon:</label>
 					 <input data-bind="value: AuthenticationController.user.phone, enable: AuthenticationController.editPhone" class="mff" name="formTel" id="formTel" type="text" placeholder=" " />
                                   </p>			
                                   <p>
                                         <li class="ui-state-default ui-corner-all" id="edycja1" title="Edytuj" data-bind="click: AuthenticationController.enableInput4"> <span class="ui-icon ui-icon-pencil">   </span></li>
					 <label for="formEmail">&nbsp;E-mail (Użytkownik):</label>
 					 <input data-bind="value: AuthenticationController.user.email, enable: AuthenticationController.editEmail" class="mff" name="formEmail" id="formEmail" type="text" placeholder=""/>
				   </p>
											
				                        
                                   <p>
                                         <li class="ui-state-default ui-corner-all" title="Edytuj" data-bind="click: AuthenticationController.enableInput5"> <span class="ui-icon ui-icon-pencil">   </span></li>       
                                         <label for="formHaslo">&nbsp;&nbsp;Nowe Haslo:</label>
 					 <input  class="mff" name="formHaslo_nowe" id="formHaslo_nowe" type="text" placeholder="" data-bind="enable: AuthenticationController.editPass"/>
				   </p>
											
				<p>
				<input class="button" id="rej" type="submit" value="Zapisz zmiany" data-bind="click: AuthenticationController.saveChanges"/>
				</p>
				</fieldset>
				<!-- End of fieldset -->
				</form>
				<!-- End of Form -->	
				</ul>
                               </div>					
				</div>
				<!-- End of First tab -->
								
																
								
				</div>
			<!-- End of Tabs -->
					</div>         
            
            
        </script>
        
        <script type="text/html" id="news-template">
            <table cellspacing="0" cellpadding="0" border="0" class="fullwidth">
                <thead>
                    <tr>
                        <!-- <td><input type="checkbox" class="checkall"></td>
                        <td>Id</td> -->
                        <td>Tytuł</td>
                        <td>Treść</td>
                        <td>Data</td>
                    </tr>
                </thead>
                <tbody data-bind="foreach: NewsController.news">
                    <tr class="odd">
                        <!-- <td><input type="checkbox"></td>
                        <td data-bind="text: id"></td> -->
                        <td data-bind="text: title"></td>
                        <td data-bind="text: content"></td>
                        <td data-bind="text: date"></td>
                    </tr>
                </tbody>
        </table>
        </script>
        
        
       
        <script type="text/html" id="gifts-template">
        <div class="message information close" data-bind="visible: GiftsController.showMessage">
                <h2>Informacja</h2>
                <p data-bind="text: GiftsController.message"></p>
        </div>
	<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
		<thead>
		 <tr>
                        
                        <td>Nazwa</td>
			<td>Obrazek</td>
			<td>Punkty</td>
                        <!-- ko if: $root.AuthenticationController.authenticated -->
                        <td>Ilość</td>
                        <td>Zamów</td>
                        <!-- /ko -->
		</tr>
		</thead>
		<tbody data-bind="foreach: GiftsController.gifts ">
                
		<tr  class="odd">
			
			<td data-bind="text: name"></td>
                      	<td data-bind="html: description"></td>
                        <td data-bind="text: points"></td>
                        <!-- ko if: $root.AuthenticationController.authenticated -->
                        <td data-bind="text: quantity"></td>
                        <td><input class="button" type="submit" value="Zamów" data-bind="click: function(data, event) { app.Knockout.GiftsController.orderGift(id(), $index()); }" /></td>
                        <!-- /ko -->
		</tr>
			
								
                </tbody>
        </table> 
        </script>
        <script type="text/html" id="searchcourses-template">
            <div class="pad20">
		<h1>Rozkład Jazdy</h1>
                
		<select name="formKierunek" class="dropdown" id="formKierunek">
			<option value="0">Kraków-Katowice</option>
			<option value="1">Katowice-Kraków</option>
		</select>
               
               <input class="button" type="button" value="Pokaż" data-bind="click: BusStopController.showCourses" />
               
             </div>  
             <div class="pad20" data-bind="visible: BusStopController.viewCourses0">
                    <table class="fullwidth" cellpadding="0" cellspacing="0" border="0" >
                                <thead>
				<tr>
                                    <td>Przystanek</td>
                                    <td>Bus1</td>
                                    <td>Bus2</td>
                                    <td>Bus1</td>
                                    <td>Bus2</td>
                                   
                                </tr>
				</thead>
                                
                  
                        
                               <tbody data-bind="foreach: BusStopController.coursesKrk">
				<tr class"odd">
                                
					<td data-bind="text: name"></td>
					<!-- ko foreach: departureTimes -->
                                            <td data-bind="text: time"></td>
                                        <!-- /ko -->
				</tr>
                                                          
                               </tbody>          
                   
                   
                   
                   				
		      
                    </table>
                </div>  
                
                <div class="pad20" data-bind="visible: BusStopController.viewCourses1">
                    <table class="fullwidth" cellpadding="0" cellspacing="0" border="0" >
                                <thead>
				<tr>
                                    <td>Przystanek</td>
                                    <td>Bus1</td>
                                    <td>Bus2</td>
                                    <td>Bus1</td>
                                    <td>Bus2</td>
                                   
                                </tr>
				</thead>
                                
                  
                        
                               <tbody data-bind="foreach: BusStopController.coursesKat">
				<tr class"odd">
                                
					<td data-bind="text: name"></td>
					<!-- ko foreach: departureTimes -->
                                            <td data-bind="text: time"></td>
                                        <!-- /ko -->
				</tr>
                                                          
                               </tbody>          
                   
                   
                   
                   				
		      
                    </table>
                </div>
                        
            
            
        </script>    
         <script type="text/html" id="points-template">
             
             
<!--         <div class="pad20">
	
	<p><a href="#dialog" class="button tooltip" title="Click me to open the dialog!" id="dialog_link"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a></p>	 	
            
                  
          <div style="display: block; position: absolute; overflow: hidden; z-index: 1015; outline: 0px; height: 65px; width: 500px; top: 80px; left: 454px;" class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-dialog">
          <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" unselectable="on"><span class="ui-dialog-title" id="ui-dialog-title-dialog" unselectable="on">Rezerwacja</span>
          <a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button" unselectable="off"><span class="ui-icon ui-icon-closethick" unselectable="off">close</span></a></div>
          <div id="dialog" style="height: 25px; min-height: 10px; width: auto;" class="ui-dialog-content ui-widget-content">
		  <p>Date: <input type="text" id="datepicker" />Time: <input type="text" id="datepicker" /> <button type="button" class="ui-state-default ui-corner-all">Zapisz</button></p>
                  
          </div>
          <div class="ui-resizable-handle ui-resizable-n" style="" unselectable="on"></div>
          <div class="ui-resizable-handle ui-resizable-e" style="" unselectable="on"></div>
          <div class="ui-resizable-handle ui-resizable-s" style="" unselectable="on"></div>
          <div class="ui-resizable-handle ui-resizable-w" style="" unselectable="on"></div>
          <div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se" style="z-index: 1001;" unselectable="on"></div>
          <div class="ui-resizable-handle ui-resizable-sw" style="z-index: 1002;" unselectable="on"></div>
          <div class="ui-resizable-handle ui-resizable-ne" style="z-index: 1003;" unselectable="on"></div>
          <div class="ui-resizable-handle ui-resizable-nw" style="z-index: 1004;" unselectable="on"></div>
         </div>       
                
            
          </div>   -->
          
      <div class="message information close">
                <h2>Informacja</h2>
                <p>Posiadasz: <span data-bind="text: AuthenticationController.user.points"></span> punktów!</p>
        </div>
        
 
        
        
        
        </script>1
        
        <script type="text/html" id="popup-template">

                
                 
          
                 
        
         </script>
        
        
        <script type="text/html" id="ticketprice-template">
         <div class="message information close" data-bind="visible: TicketPriceController.show">
                <h2>Informacja</h2>
                <p data-bind="text: TicketPriceController.errorMessage"></p>
        </div>
        <div class="pad20">
             <h2 class="demoHeaders">Wybierz trase</h2>
                  
                <select name="formKierunekk" class="dropdown" id="formKierunekk">
			<option value="0">Kraków-Katowice</option>
			<option value="1">Katowice-Kraków</option>
		</select>
               
               <input class="button" type="button" value="Pokaż"  data-bind="click: TicketPriceController.showCourses"  />
                
                <p>
                </p>
                
               </div> 
               <div class="pad20" data-bind="visible: TicketPriceController.viewCourses0" >
                z   <select name="formPrzystanekkrk" class="dropdown" id="formPrzystanekkrk">
                                        <option value=4 >Kraków RDA</option>
                                        <option value=5>Chrzanów</option>
                                        <option value=6>Katowice Górnośląska </option>
                                        <option value=7>Katowice Francuska (stacja BP)</option>
					</select>
                                        
                do   <select name="formPrzystanekkat" class="dropdown" id="formPrzystanekkat">
                                        <option value=5>Chrzanów </option>
                                        <option value=6>Katowice Górnośląska </option>
                                        <option value=7>Katowice Francuska (stacja BP)</option>
                                        <option value=8>Katowice Dw. PKP</option>
                                </select>
                
             
                
                
                </div>
                
                 <div class="pad20" data-bind="visible: TicketPriceController.viewCourses1">
                z   <select name="formPrzystanekkatt" class="dropdown" id="formPrzystanekkatt">                                        <option value="1">Katowice Dw. PKP</option>
					<option value="2">Kraków Motel Krak</option>
					<option value="3">Kraków Czarnowiejska</option>
					</select>
                                        
                do   <select name="formPrzystanekkrkk" class="dropdown" id="formPrzystanekkrkk">
                                        <option value="2">Kraków Motel Krak</option>
                                        <option value="3">Kraków Czarnowiejska</option>
                                        <option value="4">Kraków RDA </option>                                        </select>
                </div>
              
                 <div class="pad20">
                 
                <p>Czy obowiązuje ulga</p>
                <select name="formUlga" class="dropdown" id="formUlga">
                                        <option value="0">Nie</option>
					<option value="1">Tak</option>  
                </select>
              <p>   
              </p>
              <p><a href=""><input class="button" value="Wyświetl Cene" data-bind="click: TicketPriceController.countPrice"/></a> </p>
              </div> 
        </script>
        
        
        <script type="text/html" id="registration-template">
            <div class="message success close" data-bind="visible: AuthenticationController.success">
                <h2>Congratulations!</h2>
                <p>Rejestracja przebiegła pomyślnie. Przekierowanie za 3 sek...</p>
            </div>
            <div class="message error close" data-bind="visible: AuthenticationController.validation">
                <h2>Error!</h2>
                <p data-bind="text: AuthenticationController.errorMessage"></p>
            </div>
            
            
            <div class="pad20">
            <div id="tabs">
                
							
			<!-- First tab -->
				<div id="tabs-1">
				<!-- Form -->
				<form method="post" action="#" id="formularz">
				<!-- Fieldset -->
				<fieldset>
											
                                   <p>
					<label for="formImie">Imie: </label>
					<input class="mff" name="formImie" id="formImie" type="text" placeholder="Podaj imię ..."  required data-bind="css: { profitWarning: AuthenticationController.wrongName == true }" />
												
				</p>
				<p>
					<label for="formNazwisko">Nazwisko: </label>
 					<input class="mff" name="formNazwisko" id="formNazwisko" type="text" placeholder="Podaj nazwisko ..." required/> 
												
				</p>
                                <p>
					<label for="sf">Data urodzenia: </label>
																							
 					<input class="sf" name="formDzien" id="formDzien" type="text" placeholder="Dzień urodzenia ..." required/>
																						
					<select name="dropdown" class="dropdown" id="formMiesiac">
					<option value="1">Styczen</option>
					<option value="2">Luty</option>
					<option value="3">Marzec</option>
					<option value="4">Kwiecien</option>
					<option value="5">Maj</option>
					<option value="6">Czerwiec</option>
					<option value="7">Lipiec</option>
					<option value="8">Sierpien</option>
					<option value="9">Wrzesien</option>
					<option value="10">Pazdziernik</option>
					<option value="11">Listopad</option>
					<option value="12">Grudzien</option>
					</select>
											
						<input class="sf" name="formRok" id="formRok" type="text" placeholder="Rok urodzenia ..." required/>
				</p>
				<p>
						<label for="formTel">Telefon:</label>
 						<input class="mff" name="formTel" id="formTel" type="text" placeholder="Telefon kontaktowy ..."" title="Format: xxxxxxxxx" required/>
				</p>
                                
				<p>
						<label for="formEmail">E-mail (Użytkownik):</label>
 						<input class="mff" name="formEmail" id="formEmail" type="text" placeholder="E-mail ..." required/>
				</p>
											
				                        
                                <p>
						<label for="formHaslo">Hasło:</label>
 						<input class="mff" name="formHaslo" id="formHaslo" type="password" placeholder="Hasło do logowania ..."" required/>
				</p>
											
				<p>
				<input class="button" id="rej" type="submit" value="Rejestruj" data-bind="click: AuthenticationController.registerUser"/>
				<input class="button" type="reset" value="Wyczyść formularz" />
				</p>
				</fieldset>
				<!-- End of fieldset -->
				</form>
				<!-- End of Form -->	
									
				</div>
				<!-- End of First tab -->
								
																
								
				</div>
			<!-- End of Tabs -->
					</div>           
        </script>
        
        <script type="text/html" id="user-activate-template">
            <div class="message success close" data-bind="visible: AuthenticationController.activated()">
                <h2>Congratulations!</h2>
                <p>Aktywacja przebiegła pomyślnie.</p>
            </div>
            <div class="message error close" data-bind="visible: !AuthenticationController.activated()">
                <h2>Error!</h2>
                <p>Błędny hash kod.</p>
            </div>
        </script>
        
        <script type="text/html" id="statistics-template">
            <h1>Ilość rezerwacji biletów w danych miesiącach</h1>
            <img src="http://chart.apis.google.com/chart?chs=600x300&cht=p3&chd=t:1,2,3,4,5,6,7,8,9,10,11,12&chl=Stycze%C5%84%7CLuty|Marzec|Kwiecie%C5%84%7CMaj|Czerwiec|Lipiec|Sierpie%C5%84%7CWrzesie%C5%84%7CPa%C5%BAdziernik|Listopad|Grudzie%C5%84" alt="Wykres" />
        </script>      
        
        
        <!-- Application start -->
        <script type="text/javascript">
            var app = new KKBus.Application();
            app.run(${isAuthenticated});
        </script>        
    </body>
</html>